package com.example.demo.Service;

import com.example.demo.Entity.MessageEntity;
import com.example.demo.Entity.MessageVo;
import com.example.demo.Mapper.MessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    public MessageMapper messageMapper;
    public MessageEntity getLastMessage(int sessionId){
        return  messageMapper.getLastMessage(sessionId);
    }
    public List<MessageVo> getHistory(int sessionId){
        return messageMapper.getHistory(sessionId);
    }
    public  void addMessage(MessageEntity messageEntity){
        messageMapper.addMessage(messageEntity);
    }
}
